// 模拟聊天数据
const mockChats = [
  {
    id: 1,
    name: '张三',
    avatar: 'https://fastly.jsdelivr.net/npm/@vant/assets/cat.jpeg',
    lastMessage: '周末一起打球吗？',
    time: '12:30',
    unreadCount: 2
  },
  {
    id: 2,
    name: '李四',
    avatar: 'https://fastly.jsdelivr.net/npm/@vant/assets/cat.jpeg',
    lastMessage: '项目进展如何了？',
    time: '11:45',
    unreadCount: 0
  },
  // ... 更多模拟数据
]

// 模拟延迟
const delay = (ms: number) => new Promise(resolve => setTimeout(resolve, ms))

// 模拟获取聊天列表
export const getChatList = async (page: number, pageSize: number = 10) => {
  await delay(1000)
  const start = (page - 1) * pageSize
  const end = start + pageSize
  const hasMore = start < mockChats.length
  
  return {
    list: hasMore ? mockChats.slice(start, end) : [],
    hasMore
  }
}

// 模拟刷新聊天列表
export const refreshChatList = async () => {
  await delay(1000)
  return {
    list: mockChats.slice(0, 10),
    hasMore: mockChats.length > 10
  }
} 